﻿Ext.define('Sys.Module.Controller', {
    extend: 'Ext.app.Controller',
    views: ['Module.List', 'Module.Edit'],
    stores: ['Module'],
    models: ['Module'],
    refs: [{
        ref: 'modulelist',
        selector: 'grid'
    }],
    init: function () {
        this.control({
            'modulelist > btnRefresh': {
                click: this.onRefresh
            },
            'modulelist': {
                itemdblclick: this.itemdblclick
            },
            'viewport > panel': {
                render: this.onPanelRendered
            }
        });
    },
    onPanelRendered: function () {
        console.log('The panel was rendered');
    },
    itemdblclick: function () {
        var edit = Ext.create('Sys.view.module.Edit').show();
    },
    onRefresh: function () {
        alert('刷新');
    }
});